package com.info3k.client.commands.event;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.info3k.client.Info3K;
import com.info3k.client.components.EventList;

public class EventCommand implements Command {
		
	private Info3K info3k;
		
	private RootPanel parent;
	
	private String search;
	
	public EventCommand(RootPanel p, Info3K info, String search){
		this.info3k = info;
		this.parent = p;
		this.search = search;
	}
	
	public void execute() {
		parent.clear();
	
		final VerticalPanel verPanel = new VerticalPanel();
		
		verPanel.setWidth("100%");
		parent.add(verPanel);
		
		EventList eventList = new EventList(info3k, search);
		eventList.setWidth("100%");
		
		verPanel.add(eventList);
	}
}
